<?php 
/**
Pizza template for payment modules in admin area.

Copyright (c) 2010 Ingvar Harjaks <ingvarharjaks@gmail.com>
All costs of this development were covered by open source fiendy
company BrightSide OÜ
<www.brightside.ee>

    Pizza is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Pizza is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Pizza. If not, see
    <http:
    //www.gnu.org/licenses/>.
    */?>

    <?php echo $header; ?><?php echo $column_left; ?>

    <div id="content">
        <div class="page-header">
            <div class="container-fluid">
                <div class="pull-right">
                    <button type="submit" form="form-pizza" data-toggle="tooltip"
                            title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i>
                    </button>
                    <a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>"
                       class="btn btn-default"><i class="fa fa-reply"></i></a></div>
                <h1><?php echo $heading_title; ?></h1>
                <ul class="breadcrumb">
                    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
                    <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
                    <?php } ?>
                </ul>
            </div>
        </div>
        <div class="container-fluid">
            <?php if (isset($error_warning)) { ?>
            <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
                <button type="button" class="close" data-dismiss="alert">&times;</button>
            </div>
            <?php } ?>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i
                                class="fa fa-pencil"></i> <?php echo isset($text_edit)? $text_edit : 'Edit'; ?></h3>
                </div>
                <div class="panel-body">

                    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data"
                          id="form-pizza" class="form-horizontal">

                        <div class="form-group required">
                            <label class="col-sm-2 control-label"
                                   for="input-username"><?php echo $entry_username; ?></label>

                            <div class="col-sm-10">
                                <input type="text" name="<?php echo $prefix; ?>_username"
                                       value="<?php echo ${"{$prefix}_username"}; ?>"
                                       placeholder="<?php echo $entry_username; ?>" id="input-username"
                                       class="form-control"/>
                                <?php if (isset($error_username)) { ?>
                                <div class="text-danger"><?php echo $error_username ?></div>
                                <?php } ?>
                            </div>
                        </div>

                        <div class="form-group required">
                            <label class="col-sm-2 control-label"
                                   for="input-private_key"><?php echo $entry_private_key; ?></label>

                            <div class="col-sm-10">
                                <input type="text" name="<?php echo $prefix; ?>_key_sec"
                                       value="<?php echo ${"{$prefix}_key_sec"}; ?>"
                                       placeholder="<?php echo $entry_private_key; ?>" id="input-private_key"
                                       class="form-control"/>

                                <?php if (isset($error_key_sec)) { ?>
                                <div class="text-danger"><?php echo $error_key_sec ?></div>
                                <?php } ?>
                            </div>
                        </div>

                        <div class="form-group ">
                            <label class="col-sm-2 control-label"
                                   for="input-private_key_pw"><?php echo $entry_private_key_pw; ?></label>

                            <div class="col-sm-10">
                                <input type="text" name="<?php echo $prefix; ?>_key_sec_pw"
                                       value="<?php echo ${"{$prefix}_key_sec_pw"}; ?>"
                                       placeholder="<?php echo $entry_private_key_pw; ?>" id="input-private_key_pw"
                                       class="form-control"/>
                            </div>
                        </div>


                        <div class="form-group required">
                            <label class="col-sm-2 control-label"
                                   for="input-public_key"><?php echo $entry_public_key; ?></label>

                            <div class="col-sm-10">
                                <input type="text" name="<?php echo $prefix; ?>_key_pub"
                                       value="<?php echo ${"{$prefix}_key_pub"}; ?>"
                                       placeholder="<?php echo $entry_public_key; ?>" id="input-public_key"
                                       class="form-control"/>

                                <?php if (isset($error_key_pub)) { ?>
                                <div class="text-danger"><?php echo $error_key_pub ?></div>
                                <?php } ?>
                            </div>
                        </div>


                        <div class="form-group required">
                            <label class="col-sm-2 control-label"
                                   for="input-vk_acc"><?php echo $entry_vk_acc; ?></label>

                            <div class="col-sm-10">
                                <input type="text" name="<?php echo $prefix; ?>_vk_acc"
                                       value="<?php echo ${"{$prefix}_vk_acc"}; ?>"
                                       placeholder="<?php echo $entry_vk_acc; ?>" id="input-vk_acc"
                                       class="form-control"/>

                                <?php if (isset($error_vk_acc)) { ?>
                                <div class="text-danger"><?php echo $error_vk_acc ?></div>
                                <?php } ?>
                            </div>
                        </div>

                        <div class="form-group required">
                            <label class="col-sm-2 control-label"
                                   for="input-vk_name"><?php echo $entry_vk_name; ?></label>

                            <div class="col-sm-10">
                                <input type="text" name="<?php echo $prefix; ?>_vk_name"
                                       value="<?php echo ${"{$prefix}_vk_name"}; ?>"
                                       placeholder="<?php echo $entry_vk_name; ?>" id="input-vk_name"
                                       class="form-control"/>

                                <?php if (isset($error_vk_name)) { ?>
                                <div class="text-danger"><?php echo $error_vk_name ?></div>
                                <?php } ?>
                            </div>
                        </div>


                        <div class="form-group required">
                            <label class="col-sm-2 control-label"
                                   for="input-bank_url"><?php echo $entry_bank_url; ?></label>

                            <div class="col-sm-10">
                                <input type="text" name="<?php echo $prefix; ?>_bank_url"
                                       value="<?php if (isset(${"{$prefix}_bank_url"}) && strlen(${"{$prefix}_bank_url"}) != 0) { echo ${"{$prefix}_bank_url"}; } else { echo $def_bank_url; } ?>"
                                       placeholder="<?php echo $entry_bank_url; ?>" id="input-bank_url"
                                       class="form-control"/>

                                <?php if (isset($error_bank_url)) { ?>
                                <div class="text-danger"><?php echo $error_bank_url ?></div>
                                <?php } ?>
                            </div>
                        </div>

                        <div class="form-group ">
                            <label class="col-sm-2 control-label"
                                   for="input-order_status"><?php echo $entry_order_status; ?></label>

                            <div class="col-sm-10">
                                <select name="<?php echo $prefix; ?>_order_status_id" id="input-order_status"
                                        class="form-control">
                                    <?php foreach ($order_statuses as $order_status) { ?>
                                    <?php if ($order_status['order_status_id'] == ${"{$prefix}_order_status_id"}) { ?>
                                    <option value="<?php echo $order_status['order_status_id']; ?>"
                                            selected="selected"><?php echo $order_status['name']; ?></option>
                                    <?php } else { ?>
                                    <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
                                    <?php } ?>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>


                        <div class="form-group ">
                            <label class="col-sm-2 control-label"
                                   for="input-geo_zone"><?php echo $entry_geo_zone; ?></label>

                            <div class="col-sm-10">
                                <select name="<?php echo $prefix; ?>_geo_zone_id" id="input-geo_zone"
                                        class="form-control">
                                    <option value="0"><?php echo $text_all_zones; ?></option>
                                    <?php foreach ($geo_zones as $geo_zone) { ?>
                                    <?php if ($geo_zone['geo_zone_id'] == ${"{$prefix}_geo_zone_id"}) { ?>
                                    <option value="<?php echo $geo_zone['geo_zone_id']; ?>"
                                            selected="selected"><?php echo $geo_zone['name']; ?></option>
                                    <?php } else { ?>
                                    <option value="<?php echo $geo_zone['geo_zone_id']; ?>"><?php echo $geo_zone['name']; ?></option>
                                    <?php } ?>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>

                        <div class="form-group ">
                            <label class="col-sm-2 control-label"
                                   for="input-status"><?php echo $entry_status; ?></label>

                            <div class="col-sm-10">
                                <select name="<?php echo $prefix; ?>_status" id="input-status" class="form-control">
                                    <?php if (${"{$prefix}_status"}) { ?>
                                    <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                                    <option value="0"><?php echo $text_disabled; ?></option>
                                    <?php } else { ?>
                                    <option value="1"><?php echo $text_enabled; ?></option>
                                    <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>


                        <div class="form-group ">
                            <label class="col-sm-2 control-label"
                                   for="input-sort_order"><?php echo $entry_sort_order; ?></label>

                            <div class="col-sm-10">
                                <input type="text" name="<?php echo $prefix; ?>_sort_order"
                                       value="<?php echo ${"{$prefix}_sort_order"}; ?>"
                                       placeholder="<?php echo $entry_sort_order; ?>" id="input-sort_order"
                                       class="form-control"/>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
    <?php echo $footer; ?>
